using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Web.Core;
using Web.Core.Objects;

namespace Web.Core.Providers
{
    public abstract class DataProvider
    {
        static DataProvider instance = null;
        public static DataProvider GetInstance()
        {
            if (instance != null) return instance;
            else
                return new SqlProvider();
        }

        #region Products Table
        public abstract int CountProducts(GlobalStorage.TypeProducts type, int category, GlobalStorage.Show visible, int language, float pPrice, int pManufacturer, string pName, string pDes);
        public abstract ArrayList GetProducts(GlobalStorage.TypeProducts type, int category, GlobalStorage.Show visible, int language, string orderBy, int pageNumber, int pageSize, GlobalStorage.Order order, int pID, float pPrice, int pManufacturer, string pName, string pDes);
        public abstract ArrayList GetBestSellers(int lang);
        public abstract int CreateUpdateDeleteProducts(Product pro, ShopContent content, GlobalStorage.Action choice);
        public abstract ArrayList GetProductSpecial(int top, int language, bool special);
        public abstract ArrayList GetProductBit(int num, int language, bool special, bool promotion, bool newest);
        #endregion

        #region Categories Table
        public abstract int CountCategories(string catName, string catDes, int catSequence, int lang);
        public abstract ArrayList GetCategories(int catID, string catName, string catDes, int catSequence, int lang,int parent);
        public abstract ArrayList GetCategoriesByQuantity(int quantity, int lang);
        public abstract ArrayList GetAllCategories(int language, int pageNumber, int pageSize);
        public abstract ArrayList GetAllCategoriesByManufact(int manu,int lang);
        public abstract ArrayList GetAllChild(int parentID, int lang);
        public abstract int CreateUpdateDeleteCategories(Category cat, ShopContent content, GlobalStorage.Action choice);
        public abstract ArrayList GetTop(int lang);
        #endregion

        #region Manufacturers Table
        public abstract ArrayList GetManufacturers(int mID, string mName, string mURL);
        public abstract ArrayList GetAllManufacturers(int pageNumber, int pageSize);        
        public abstract int CreateUpdateDeleteManufacturers(Manufacturer man, GlobalStorage.Action choice);        
        #endregion

        #region Advertisements Table
        public abstract ArrayList GetAdvertisements(Advertisement ads);
        public abstract ArrayList GetAllAdvertisements(int pageNumber, int pageSize);        
        public abstract int CreateUpdateDeleteAdvertisements(Advertisement ads, GlobalStorage.Action choice);
        #endregion

        #region Members Table
        public abstract ArrayList GetMembersSearch(Member mem, int pageNum, int pageSize, string orderBy, GlobalStorage.Order order);
        public abstract ArrayList GetMembers(Member mem, int pageNum, int pageSize, string orderBy, GlobalStorage.Order order);
        public abstract int CountMembers(Member mem);
        public abstract int CountMembersSearch(Member mem);
        public abstract int InsertDeleteUpdateMember(Member mem, GlobalStorage.Action choice);
        #endregion

        #region Roles Table
        public abstract ArrayList GetRoles(int id, string name);
        #endregion

        #region Currencies Table
        public abstract int CreateUpdateDeleteCurrencies(Currency cur, GlobalStorage.Action choice);
        public abstract ArrayList GetCurrencies(int cID, string cName, string cSymbol, float cRate);
        #endregion

        #region Languages Table        
        public abstract ArrayList GetLanguages(int lID, string lName);
        #endregion

        #region ContactUs Table
        public abstract int InsertDeleteUpdateContact(Contact c, GlobalStorage.Action choice);
        public abstract ArrayList GetContact(Contact c, int pageNumber, int pageSize);
        public abstract int CountContact(Contact c);
        #endregion

        #region ShoppingCart Table
        public abstract int InsertDeleteUpdateCart(Cart c, GlobalStorage.Action choice);
        public abstract Carts GetCart(Cart c);
        #endregion

        #region Logs Table
        public abstract int InsertDeleteUpdateLog(Log l, GlobalStorage.Action choice);
        public abstract ArrayList GetLogs(Log l, int pageNumber, int pageSize);
        public abstract int CountLogs(Log l);
        #endregion

        #region Orders Table
        public abstract int InsertDeleteUpdateOrder(Order o, GlobalStorage.Action choice);
        public abstract ArrayList GetOrders(Order o, int pageNumber, int pageSize, int memID);
        public abstract int CountOrders(Order o);
        public abstract int CountOrdersByMemberID(int memberID);
        #endregion

        #region Reviews Table
        public abstract ArrayList GetReviews(int productID);
        public abstract Review GetReviewsByID(int reviewID);
        public abstract ArrayList GetReviews(int productID, int pageNumber, int pageSize);
        public abstract int CreateUpdateDeleteReview(Review rev, GlobalStorage.Action choice);
        #endregion Reviews Table

        #region Table Article

        public abstract ArrayList GetAllArticle(int id, string title, string type, int lang);
        //public abstract int abchdhfj(Article rev, GlobalStorage.Action choice);
        public abstract int CreateUpdateDeleteArticle(Article rev, ShopContent shop, GlobalStorage.Action choice);
        //public abstract ArrayList GetArticleByType(string type, int lang);

        #endregion Table Article
    }
}
